<template>
	<div class="j-new-cotent">
		<div class="container">
			<h2 class="new-title">{{newTitle}}</h2>
			<p class="new-sub-title">
				<span>{{newFlag}}</span>
				<span>{{newNum}}</span>
			</p>
			<div  v-html="newCotent" class="new-content"></div>
			<div class="n-icon">
				<ul>
					<li><img src="../../assets/qq-kj.png" alt=""></li>
					<li>
						<!--<a href="http://service.weibo.com/share/share.php?appkey=&title=&url=&searchPic=false&style=simple" target="_blank">-->
							<img src="../../assets/weibo.png" alt="">
						<!--</a>-->
					</li>
					<li><img src="../../assets/tx-weibo.png" alt=""></li>
					<li><img src="../../assets/weixin.png" alt=""></li>
				</ul>
			</div>
		</div>
	</div>
</template>
<script>
import api from '../../service/api'
export default {
  data () {
    return {
      newTitle: '',
      newNum: '',
      newCotent: '',
      newFlag: ''
	  }
  },
  methods: {
    findNewsById (id) {
      api.findNewsById(id)
        .then(res => {
          if (res.code === 200) {
	          this.newTitle = res.result.title
	          // this.newNum = res.result.num
	          this.newCotent = res.result.content
	          this.newNum = res.result.createdate.split(' ')[0]
	          if (res.result.flag === '1') {
	            this.newFlag = '[ 集团动态 ]'
	          } else if (res.result.flag === '2') {
              this.newFlag = '[ 应用案例 ]'
	          } else if (res.result.flag === '3'){
              this.newFlag = '[ 行业新闻 ]'
	          }
          } else {
            console.log(res.msg)
          }
        })
        .catch(err => {
          console.log(err)
        })
    }
  },
  created () {
	  this.findNewsById(this.$route.query.id)
  }
}
</script>
<style  rel="stylesheet/scss" type="text/scss" lang="scss" scoped>
	.j-new-cotent{
		.container{
			width: 900px;
			border: 1px solid red;
			.new-title{
				margin: 60px auto 50px auto;
				text-align: center;
			}
			.new-sub-title{
				margin: 0;
				text-align: center;
				span{
					margin: 0 10px;
				}
				.icon-eye-open{
					vertical-align: top;
					display: inline-block;
					width: 15px;
					height: 19px;
					padding-top: 2px;
					background: url("../../assets/eye.png") no-repeat;
					background-position-y: 2px;
				}
			}
			.new-content{
				margin-top: 75px;
				padding: 0 30px;
			}
			.n-icon{
				margin: 100px 0;
				padding: 0 30px;
				width: 100%;
				ul{
					text-align: right;
					margin: 0;
					li{
						list-style: none;
						display: inline-block;
						width: 35px;
						margin: 0 3px;
						cursor: pointer;
						img{
							max-width: 100%;
						}
					}
				}
			}
		}
	}
</style>
<style  rel="stylesheet/scss" type="text/scss" lang="scss">
	@media screen and (max-width: 991px){
		.j-new-cotent{
			.container{
				width: 100%!important;
				border: 1px solid red;
				.new-content{
					margin-top: 75px;
					padding: 0 15px;
				}
			}
		}
	}
</style>